{extend name="admin/public/base"/}
{block name="body"}
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">{$meta_title}</h3>
        <div class="pull-right">
            <a href="{:url('/admin/config/group')}" class="btn btn-danger">
                <i class="fa fa-list"></i> 
                配置管理
            </a>
            <a href="{:url('/admin/config/add')}" class="btn btn-danger">
                <i class="fa fa-plus"></i> 
                添加配置
            </a>
        </div>
    </div>
    <div class="box-body">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li {if !$group_id}class="active"{/if}><a href="{:url('/admin/config/index')}">全部</a></li>
                {volist name="config['config_group_list']" id="item"}
                <li {if $group_id == $item['key']}class="active"{/if}>
                    <a href="{:url('/admin/config/index?group='.$item['key'])}">{$item['label']}</a>
                </li>
                {/volist}
            </ul>
            <div class="tab-content">
                <div class="tab-pane fade in active">
                    <div class="table-responsive clearfix">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th class="row-selected">
                                        <input class="checkbox check-all" type="checkbox">
                                    </th>
                                    <th>ID</th>
                                    <th>名称</th>
                                    <th>标题</th>
                                    <th>分组</th>
                                    <th>类型</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {notempty name="list"}
                                {volist name="list" id="config"}
                                    <tr>
                                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$config['id']}"></td>
                                        <td>{$config.id}</td>
                                        <td><a href="{:url('/admin/config/edit', ['id' => $config['id']])}">{$config['name']}</a></td>
                                        <td>{$config['title']}</td>
                                        <td>{$group[$config['group']]|default=''}</td>
                                        <td>{$config['type_text']}</td>
                                        <td>
                                            <a title="编辑" href="{:url('/admin/config/edit', ['id' => $config['id']])}">编辑</a>
                                            <a class="confirm ajax-get" title="删除" href="{:url('/admin/config/del', ['id' => $config['id']])}">删除</a>
                                        </td>
                                    </tr>
                                {/volist}
                            {else/}
                                <td colspan="7" class="text-center"> aOh! 暂时还没有内容!</td>
                            {/notempty}
                            </tbody>
                        </table>
                    </div>
                    {$page|raw}
                </div>
            </div>
        </div>
    </div>
</div>

{/block}